/**
 * Created by HX on 2016/11/4.
 */
var React = require('react');

var DataTable = React.createClass({
    handleUpdate : function(id,status){
        this.props.updateData(id,status);
    },
    render : function(){
        var t =this.props.action;
        if(t.status == 0){
            return (<button onClick={ this.handleUpdate.bind(this,t.id,1) } className="btn btn-primary">Open</button>);
        }else{
            return (<button onClick={ this.handleUpdate.bind(this,t.id,0) } className="btn btn-primary">Close</button>);
        }
    }
});

module.exports = DataTable;